$(function() {
		//登录
		$("#login-submit").linkbutton({
			onClick:function(){
				var username = $("#login-username").textbox("getValue");
				var password = $("#login-password").passwordbox("getValue");
				
					$("#login-form").form({
						url:"login",
						method:"post",
						onSubmit:function(){
							if (!username.length >0 && !password.length>0) {
								$.messager.alert("警告","账户或者密码不能为空!",'info')
								return false;    
							}
						},
						success:function(data){
							if ($.trim(data)=='success') {
								window.location.href='http://localhost:8080/crm/index';
							}else {
								$.messager.alert('提示','账号或密码错误!','info');
								$("#login-password").passwordbox("clear");
							}
						}
					}).submit();
				}
		})
	})